import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            String str1 = in.nextLine();
            String str2 = in.nextLine();
            int[] hash = new int[128];
            for (char c : str2.toCharArray()) {
                hash[c]++;
            }
            StringBuilder ret = new StringBuilder();
            for (char c : str1.toCharArray()) {
                if (hash[c] == 0) {
                    ret.append(c);
                }
            }
            System.out.println(ret.toString());
        }
    }
}
